<?php
namespace app\index\controller;
use think\facade\View;
class Index
{
    public function index()
    {

//        dump(1);exit;
        $timestamp = '?v=' . time();
        $is_we7 = defined('IS_WEIQIN') ? true : false;
        $appcss = $is_we7 ? '/addons/'. APP_MODEL_NAME .'/core2/public/static/css/app.css' : '/static/css/app.css';
        $manifest = $is_we7 ? '/addons/'.APP_MODEL_NAME.'/core2/public/static/js/manifest.js' : '/static/js/manifest.js';
        $vendor =  $is_we7 ?  '/addons/'.APP_MODEL_NAME.'/core2/public/static/js/vendor.js' : '/static/js/vendor.js';
        $app = $is_we7 ? '/addons/'.APP_MODEL_NAME .'/core2/public/static/js/app.js' : '/static/js/app.js';
        $jsPath = $is_we7 ?  '/addons/'.APP_MODEL_NAME .'/core2/public/' : '/';

        $jsMin = $is_we7 ?  '/addons/'.APP_MODEL_NAME .'/core2/public/js/jquery.min.js' : '/js/jquery.min.js';

        $jsPdf = $is_we7 ?  '/addons/'.APP_MODEL_NAME .'/core2/public/js/pdf.js' : '/js/pdf.js';

        $jsWorker= $is_we7 ?  '/addons/'.APP_MODEL_NAME .'/core2/public/js/pdf.worker.js' : '/js/pdf.worker.js';

        $jsVueMin = $is_we7 ?  '/addons/'.APP_MODEL_NAME .'/core2/public/js/vue.min.js' : '/js/vue.min.js';

        $jsVuexMin = $is_we7 ?  '/addons/'.APP_MODEL_NAME .'/core2/public/js/vuex.min.js' : '/js/vuex.min.js';

        $jsMmin = $is_we7 ?  '/addons/'.APP_MODEL_NAME .'/core2/public/js/moment.min.js' : '/js/moment.min.js';

        $jsIndexMin = $is_we7 ?  '/addons/'.APP_MODEL_NAME .'/core2/public/js/index.min.js' : '/js/index.min.js';

        $jsMincss = $is_we7 ?  '/addons/'.APP_MODEL_NAME .'/core2/public/js/index.min.css' : '/js/index.min.css';

        $jsNcss = $is_we7 ?  '/addons/'.APP_MODEL_NAME .'/core2/public/js/nprogress.min.css' : '/js/nprogress.min.css';

        global  $_W;
        $is_founder = isset($_W['isfounder']) ? $_W['isfounder'] : false;

        View::assign('jsPath', $jsPath);

        View::assign('jsMin', $jsMin);

        View::assign('jsPdf', $jsPdf);

        View::assign('jsWorker', $jsWorker);

        View::assign('jsVueMin', $jsVueMin);

        View::assign('jsVuexMin', $jsVuexMin);

        View::assign('jsMmin', $jsMmin);

        View::assign('jsIndexMin', $jsIndexMin);

        View::assign('jsMincss', $jsMincss);

        View::assign('jsNcss', $jsNcss);

        View::assign('is_founder', $is_founder);
        View::assign('isWe7', $is_we7);
        View::assign('appcss', $appcss.$timestamp);
        View::assign('manifest', $manifest .$timestamp);
        View::assign('vendor', $vendor .$timestamp );
        View::assign('app', $app . $timestamp);

        //var_dump(View());die;
        return View::fetch();
        // return View::engine('think')->fetch('index');
    }
}
